package com.example.domain;

import java.util.Date;
import java.util.Objects;

public class t_comment {
    private Integer id;         // 评论id
    private Integer article_id; // 评论的文章id
    private String content;    // 评论内容
    private Date created;      // 评论日期
    private String author;     // 评论作者名
    private String ip;          // 评论用户登录ip
    private String status;     // 评论状态，默认审核通过approved
    //private boolean avatar; //评论作者头像是否存在
    private int hits;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        t_comment comment = (t_comment) o;
        return hits == comment.hits &&
                Objects.equals(id, comment.id) &&
                Objects.equals(article_id, comment.article_id) &&
                Objects.equals(content, comment.content) &&
                Objects.equals(created, comment.created) &&
                Objects.equals(author, comment.author) &&
                Objects.equals(ip, comment.ip) &&
                Objects.equals(status, comment.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, article_id, content, created, author, ip, status, hits);
    }

    public int getHits() {
        return hits;
    }

    public void setHits(int hits) {
        this.hits = hits;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getArticle_id() {
        return article_id;
    }

    public void setArticle_id(Integer article_id) {
        this.article_id = article_id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "id=" + id +
                ", articleId=" + article_id +
                ", content='" + content + '\'' +
                ", created=" + created +
                ", author='" + author + '\'' +
                ", ip='" + ip + '\'' +
                ", status='" + status + '\'' +
                '}';
    }
}
